package org.wyn.mongodb.bean;

import java.util.LinkedList;
import java.util.List;

import org.wyn.common.Table;

import com.google.code.morphia.annotations.Entity;
import com.google.code.morphia.annotations.Id;
import com.google.code.morphia.annotations.Transient;

/**
 * 用户互访历史记录
 * @author 
 *
 */
@Entity(value=Table.CollectionName.VISITHISTORY,noClassnameStored=true)
public class VisitHistory {
	public VisitHistory(){
		
	}
	public VisitHistory(String userName){
		this.userName = userName;
	}
	@Id
	private String userName;//用户
	//最近访问该用户的用户列表
	private List<String> recentVisitors = new LinkedList<String>();//个人认为会有较多的表头插入，随机删除操作所以用linkedlist比较好
	/**最近访问记录数保存最大数*/
	@Transient
	public static final int MAX_VISITORS_NUM = 20;
	public String getUserName() {
		return userName;
	}
	public void setUserName(String userName) {
		this.userName = userName;
	}
	public List<String> getRecentVisitors() {
		return recentVisitors;
	}
	public void setRecentVisitors(List<String> recentVisitors) {
		this.recentVisitors = recentVisitors;
	}
	
}
